/**
 * 
 */
package com.jonosoft.photocast.viewer.web.client.ui.imagecollections;

import com.jonosoft.photocast.viewer.web.client.ImageCollection;

/**
 * TODO Add description ImageCollectionsByMonthMenuItem (com.jonosoft.photocast.viewer.web.client.ui.imagecollections.ImageCollectionsByMonthMenuItem)
 *
 * @author jon
 *
 */
public class ImageCollectionsByMonthMenuItem extends ImageCollectionsMenuItem {
	
	private String year = null;
	private int month = 0;

    public ImageCollectionsByMonthMenuItem(ImageCollection imageCollection, String year, int month) {
	    super(imageCollection);
	    setYear(year);
	    setMonth(month);
	    setText(getNameOfMonth(month));
    }

	public String getYear() {
		return this.year;
	}
    
    public int getMonth() {
    	return this.month;
    }
	
	public void setYear(String year) {
		this.year = year;
	}
    
    public void setMonth(int month) {
    	this.month = month;
    }
    
    private String getNameOfMonth(int month) {
    	switch (month) {
    		case 0: return "January";
    		case 1: return "February";
    		case 2: return "March";
    		case 3: return "April";
    		case 4: return "May";
    		case 5: return "June";
    		case 6: return "July";
    		case 7: return "August";
    		case 8: return "September";
    		case 9: return "October";
    		case 10: return "November";
    		case 11: return "December";
    		default: return getNameOfMonth((month < 0) ? (month + 12) : (month - 12));
    	}
    }
}
